import { Tabs } from 'nextra/components'
import BadgeGroup, { UniverTypes } from '@/components/BadgeGroup'

# Conditional Formatting

<BadgeGroup values={[UniverTypes.SHEET]} value={UniverTypes.SHEET} />

Conditional formatting is a feature that sets rules in cells to automatically set cell formats based on the value of the data.

## Installation

<Tabs items={['pnpm', 'npm']}>
  <Tabs.Tab label="pnpm">
    ```shell
    pnpm add @univerjs/sheets-conditional-formatting-ui
    ```
  </Tabs.Tab>
  <Tabs.Tab label="npm">
    ```shell
    npm install @univerjs/sheets-conditional-formatting-ui
    ```
  </Tabs.Tab>
</Tabs>

## Import

```typescript
import '@univerjs/sheets-conditional-formatting-ui/lib/index.css';

import { UniverSheetsConditionalFormattingUIPlugin } from '@univerjs/sheets-conditional-formatting-ui';
```

## Internationalization

```typescript
import { LocaleType, Tools } from '@univerjs/core';
import SheetsConditionalFormattingUIEnUS from '@univerjs/sheets-conditional-formatting-ui/locale/en-US';

const univer = new Univer({
  theme: defaultTheme,
  locale: LocaleType.EN_US,
  locales: {
    [LocaleType.EN_US]: Tools.deepMerge(
      SheetsConditionalFormattingUIEnUS
    ),
  },
});
```

## Register

```typescript
univer.registerPlugin(UniverSheetsConditionalFormattingUIPlugin);
```
